import type { DictType } from '@/api/modules/auth/dict.type';
import type { Rule } from 'ant-design-vue/es/form';

const formObj: DictType = {
  dictId: '',
  dictName: '',
  dictType: '',
  dictValue: '',
};
export const form = ref<DictType>({
  ...formObj,
});

export const formRef = ref();

export const resetForm = () => {
  form.value = {
    ...formObj,
  };
};
export const formRules: Record<keyof DictType, Rule[]> = {
  dictName: [{ required: true }],
  dictType: [{ required: true }],
  dictValue: [],
  dictId: [],
};
